﻿/*****************************************************************//**
 * @file    FITKAcousticsVTKGraphObjectSEAShell.h
 * @brief   Graph object for SEA sub-system shell data.
 *  
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-11-04
 *********************************************************************/

#ifndef __FITKACOUSTICSVTKGRAPHOBJECTSEASHELL_H__
#define __FITKACOUSTICSVTKGRAPHOBJECTSEASHELL_H__

#include "FITKAcousticsVTKGraphObjectSEASubSystem.h"

#include "FITKAcousticsVTKGraphAdaptorAPI.h"

// Forward declaration
class vtkUnstructuredGrid;
class vtkPoints;

class FITKAcousticsVTKGraphActor;

namespace Acoustics
{
    class FITKAbstractSEASubSysShell;
}

namespace Exchange
{
    /**
     * @brief   Graph object for 'SEA sub-system shell'.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-11-04
     */
    class FITKACOUSTICSGRAPHADAPTORAPI FITKAcousticsVTKGraphObjectSEAShell : public FITKAcousticsVTKGraphObjectSEASubSystem
    {
        // Regist
        FITKGraphObjectRegist(FITKAcousticsVTKGraphObjectSEAShell, FITKAcousticsVTKGraphObjectSEASubSystem);
        FITKCLASS(Exchange, FITKAcousticsVTKGraphObjectSEAShell);

    public:
        /**
         * @brief   Constructor.
         * @param   shell: The sub-system shell data
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        FITKAcousticsVTKGraphObjectSEAShell(Acoustics::FITKAbstractSEASubSysShell* shell);

        /**
         * @brief   Destructor.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        ~FITKAcousticsVTKGraphObjectSEAShell();

        /**
         * @brief   Update the visibility with data object's visibility.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-12
         */
        void updateVisibility() override;

        /**
         * @brief   Get the visibility from the data object.[override]
         * @return  The visibility
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-29
         */
        bool getDataVisibility() override;

    private:
        /**
         * @brief   Initialize the vtk objects.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-14
         */
        void init() override;

        /**
         * @brief   Generate the vtkDataSet for the sub-system.[override]
         * @param   subSys: The sub-system shell data
         * @return  Is the data valid
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        bool generateDataSet(Acoustics::FITKAbstractSEASubSys* subSys) override;

        /**
         * @brief   Generate the actor with the sub-system data.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        void generateGraph() override;

        /**
         * @brief   Get the scale factor of the sub system.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-08
         */
        double getScaleFactor() override;

        /**
         * @brief   Clear all vtk data.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-14
         */
        void resetVtkData() override;

    private:
        /**
         * @brief   The grid data for the sub-system bounds.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-14
         */
        vtkUnstructuredGrid* m_ugridBounds{ nullptr };

        /**
         * @brief   The actor for the sub-system grid.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        FITKAcousticsVTKGraphActor* m_fActorBounds{ nullptr };

    };
}   // namespace Exchange

#endif // __FITKACOUSTICSVTKGRAPHOBJECTSEASHELL_H__
